const showDate = timestamp => {
	return uni.$tools.date('m月d日 H:i', timestamp);
};
const showCustomDate = (format,timestamp) => {
	return uni.$tools.date(format, timestamp);
};
//处理时间 date如秒去1000
const toDayHHmmss = (date) => {
   var time;
   var day = parseInt(date / ( 60 * 60 * 24)) 
   var hours = parseInt((date % ( 60 * 60 * 24)) / ( 60 * 60));
   var minutes = parseInt((date % ( 60 * 60)) / ( 60));
   var seconds = (date % ( 60));
   time = (hours < 10 ? ('0' + hours) : hours) + ':' + (minutes < 10 ? ('0' + minutes) : minutes) + ':' + (seconds < 10 ? ('0' + seconds) : seconds);
   if(day>0){
	   time = day + '天 '+time;
   }
   return time;
}
const showStatusTxt = status => {
	// console.log(" showStatusTxt status===",status)
	let txt = '';
	switch (+status) {
		case 0:
			txt = '待付款';
			break;
		case -1:
			txt = '已取消';
			break;
		case -2:
			txt = '已取消'; //付完款取消
			break;
		case 10:
			txt = '预约中'; //已付款，待取车
			break;
		case 20:
			txt = '进行中'; //已取车，待还车
			break;
		case 200:
			txt = '已逾期'; //属于进行中
			break;
		case 30:
			txt = '已完成';
			break;
	}
	return txt;
};


export{
	showDate,
	showCustomDate,
	toDayHHmmss,
	showStatusTxt,
}
